var app = angular.module('myApp', ['ngSanitize']);
    app.controller('skuDetailCtrl', function($scope,$http) {
        $scope.myText = "<h1>John Doe</h1>";
        var spu_Id = getQueryString('spu_Id');
        console.log(spu_Id)
        $http({
            method: 'POST',
           // url: "http://192.168.0.32:7050/aproduct/product/skuDetailList",
            url:root.goodsInter.goods_skuDetailList,
            data: {
                spuId:spu_Id,
                wareHouseId:1,
                platformType:1,
                cityId:1,
            }
        }).then(function successCallback(response) {
            // 请求成功执行代码
            console.log(response.data.color);
            console.log(response.data.data);
            $scope.skuItems = response.data.data;
            $scope.skuColor = response.data.color;
        }, function errorCallback(response) {
            // 请求失败执行代码
            alert("请求数据失败！");
        });
        $http({
            method: 'POST',
            url:root.goodsInter.goods_skuShopDetailInformation,
            data: {
                spuId:spu_Id,
                skuId:"",
            }
        }).then(function successCallback(response) {
            // 请求成功执行代码
            console.log(response.data.spuDetail);
            $scope.spuDetail = response.data.spuDetail;
        }, function errorCallback(response) {
            // 请求失败执行代码
            alert("请求数据失败！");
        });
    }).config(function($httpProvider) {
        $httpProvider.defaults.transformRequest = function(obj) {
            var str = [];
            for(var p in obj) {
                str.push(encodeURIComponent(p) + "=" + encodeURIComponent(obj[p]));
            }
            return str.join("&");
        };
        $httpProvider.defaults.headers.post = {
            'Content-Type': 'application/x-www-form-urlencoded'
        }

    });